$(document).ready(function() {

	var button = $('#uploadButton'), interval;

	$.ajax_upload(button, {
		action : '../library/upload.php',
		name : 'myfile',
		onSubmit : function(file, ext) {
			$("img#load").attr("src", "../images/ajaxupload/load.gifload.gif");
			$("#uploadButton font").text('Загрузка');
			this.disable();
		},
		onComplete : function(file, response) {
			$("img#load").attr("src", "../images/ajaxupload/load.gifloadstop.gif");
			$("#uploadButton font").text('Загрузить');
			this.enable();
			$("<li>" + response + "</li>").appendTo("#files");
		}
	});

});